home *** CD-ROM | disk | FTP | other *** search
/ BBS Toolkit / BBS Toolkit.iso / qbbs / rachad10.zip / CHGADDR.DOC next >
Text File  |  1990-08-05  |  18KB  |  643 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11.  
  12.                                     ChgAddr V1.0                                    ChgAddr V1.0
  13.                      Network Mail Re-Addresser for RemoteAccess                     Network Mail Re-Addresser for RemoteAccess
  14.  
  15.  
  16.  
  17.  
  18.                              by Marc A. Shannon, 129/45                             by Marc A. Shannon, 129/45
  19.                                    August 5, 1990                                   August 5, 1990
  20.  
  21.  
  22.  
  23.  
  24.  
  25.  
  26.  
  27.  
  28.  
  29.  
  30.                                       Chapter 1                                      Chapter 1
  31.  
  32.                                     Introduction                                    Introduction
  33.  
  34.  
  35.           ChgAddr is a program  which  can  be  used with your RemoteAccess
  36.           system  to  "correct"  the  source  or  destination  Network Mail
  37.           address of any message in your RA message base in the first board
  38.           listed as being for "NetMail".  (See page 26 of  the RemoteAccess
  39.           documentation for information on  setting  up  a message area for
  40.           use with Network Mail.)
  41.  
  42.           Using  a simple configuration file, you  can  tell  ChgAddr  what
  43.           messages you want "altered" to suit your network setup.   You can
  44.           include  multiple  rules  to  suit  as many changes as you  need.
  45.           There is no limit on the number of rules you  can  include in the
  46.           configuration  file except for the limit  of  your  system's  (or
  47.           window's) memory size.
  48.  
  49.           As  with  most,  if not all, other software products available on
  50.           FidoNet, no guarantee is given  to the stability of this program.
  51.           It might trash your message base,  but  it probably won't.  All I
  52.           know is that it works on my system.
  53.  
  54.           The archive as sent out on SDSRA includes five files:
  55.  
  56.                  CHGADDR.EXE  The actual executable program
  57.  
  58.                  SAMPLE.CFG   A  sample configuration file which shows  use
  59.                               of the different possible rules
  60.  
  61.                  CHGADDR.DOC  The documentation formatted for any  standard
  62.                               printer
  63.  
  64.                  CHGADDR.EPS  The   documentation   formatted   for   Epson
  65.                               printers  (or  those which  emulate  standard
  66.                               Epson MX-80 codes)
  67.  
  68.                  README       A brief summary of what ChgAddr does
  69.  
  70.           This program is somewhat ShareWare.   If  you use it and you like
  71.           it, you don't owe anything.   If  you  would like me to know that
  72.           you really like it, you may send in a small  amount  of money (no
  73.           more than $5 please) to:
  74.  
  75.  
  76.  
  77.  
  78.                Marc Shannon
  79.                ChgAddr Donation
  80.                CMU P. O. Box 257
  81.                Pittsburgh, PA  15213-3890
  82.  
  83.           If you do send $5, I will, first of all, be interested in writing
  84.           future programs that  work  with RemoteAccess, and also will make
  85.           sure that I send you any new versions of ChgAddr  as  well as any
  86.           new  RA support programs that I write.    Alternatively,  if  you
  87.           would like, just send me a NetMail message and I'll be happy with
  88.           that.
  89.  
  90.  
  91.  
  92.  
  93.  
  94.  
  95.  
  96.  
  97.  
  98.  
  99.  
  100.  
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.  
  130.                                         - 2 -
  131.  
  132.  
  133.  
  134.  
  135.  
  136.  
  137.  
  138.  
  139.  
  140.  
  141.                                       Chapter 2                                      Chapter 2
  142.  
  143.                             Requirements and restrictions                            Requirements and restrictions
  144.  
  145.  
  146.           ChgAddr was written on a 80386-SX system running  MS-DOS  3.3 and
  147.           RemoteAccess 0.04a, but should work on any MS-DOS 3.x system with
  148.           RemoteAccess 0.03  or later (not including 1.00 which may require
  149.           a rewrite of the message-base structures).  ChgAddr is written in
  150.           C using  the  Turbo  C  2.0  compiler.   (If you're interested in
  151.           seeing my RASTRUCT.H file, you can FREQ it from 129/45.)
  152.  
  153.           In order to  run  ChgAddr,  you  only need to follow the standard
  154.           setup   procedures   for   RemoteAccess   and  then  create  your
  155.           configuration  file,  CHGADDR.CFG.     ChgAddr  will  check  your
  156.           environment for the RA variable.   If  found, it will use this to
  157.           find your RemoteAccess configuration and then  use  your message-
  158.           base path listed in there. If the RA environment variable  is not
  159.           found, ChgAddr will do all its work from the current directory.
  160.  
  161.           You should place your CHGADDR.CFG  file in the directory that the
  162.           RA environment variable points to.   (If  it is not found in that
  163.           directory, the current directory is also checked.)
  164.  
  165.           ChgAddr is only  16K  and  should  work fine in even the smallest
  166.           memory configuration.  (You may need more memory  for  ChgAddr to
  167.           run if you have zillions of rewrite rules, though.)
  168.  
  169.           At  its  peak,  ChgAddr only opens 4 files concurrently, which is
  170.           less than RemoteAccess opens.  ChgAddr will tell you, however, if
  171.           it  is  unable  to open a file needed for proper operation.  When
  172.           running,  it  always  opens the files with sharing options so it,
  173.           theoretically, could  be run in a multi-line situation.  Standard
  174.           DOS locks are taken out on the records being modified  to prevent
  175.           accidental conflicts.  This only works if any other programs with                                      only
  176.           access the message-base use these locking routines.
  177.  
  178.           It should be mentioned  that  this release of ChgAddr DOES NOT do                                                                DOES NOT
  179.           anything with respect to points.  Any point  values  specified in
  180.           the configuration file are flagged as invalid.
  181.  
  182.  
  183.  
  184.  
  185.  
  186.  
  187.                                         - 3 -
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195.  
  196.  
  197.  
  198.                                       Chapter 3                                      Chapter 3
  199.  
  200.                              Configuration (rules) file                             Configuration (rules) file
  201.  
  202.  
  203.           This  is where the guts of the  ChgAddr  configuration  file  are
  204.           explained.
  205.  
  206.           First off, your configuration file should be placed either in the
  207.           directory where you plan to  run ChgAddr during your normal batch
  208.           file  processing  of  exporting  NetMail  messages  or   in  your
  209.           RemoteAccess system file  directory  (as defined by, and I'll say
  210.           it again, your RA environment variable).
  211.  
  212.           The ChgAddr configuration  file  is a "free-format" file with one
  213.           small exception.  You  may  include comments on any line when you
  214.           use a semicolon (;) in front of your comment text.  The exception
  215.           to  the   "free-format"  is  that  blank  lines  have  a  special
  216.           significance.
  217.  
  218.           Your configuration file  can  contain many "rules", each of which
  219.           can specify a certain address  match  with  certain  rewrites for
  220.           those matches.  Between each rule, you need to have a blank line.
  221.           You may include as many rewrite rules in  the  configuration file
  222.           as you need or want.  In processing, ChgAddr will only  apply the
  223.           FIRST rewrite rule which matches the particular message.          FIRST
  224.  
  225.           Each rewrite rule can include  up to four clauses: Old-From, Old-
  226.           To, New-From, and New-To.    The "old" clauses may contain one or
  227.           more  network  addresses  while  the  "new"  clauses  should only
  228.           contain one address.
  229.  
  230.           A fully specified rule could be shown as:
  231.  
  232.                [Old-From addr-list]
  233.                [Old-To addr-list]
  234.                [New-From addr]
  235.                [New-To addr]
  236.  
  237.           where the "addr-list" would  be  one  or more addresses, possibly
  238.           including  the  use  of  "All"  or "Except" phrases.  The  format
  239.           follows (as closely as possible) the format used  by  many mailer
  240.           programs which allow for multiple address specifications.  "addr-
  241.           list"  may  span  multiple lines provided that there is no clause
  242.  
  243.  
  244.                                         - 4 -
  245.  
  246.  
  247.  
  248.  
  249.           keyword  in  the  middle  and  that  there  isn't  a  blank  line
  250.           separating the addresses. You'd  probably  better  check  out the
  251.           SAMPLE.CFG file for a  better  idea of what the address lists can
  252.           look like.
  253.  
  254.           Let's examine the use  of  the  Old-From  clause.  (The following
  255.           examples  are  taken  from  the  first  rule  in  the  SAMPLE.CFG
  256.           configuration file provided with the ChgAddr V1.0 archive.)
  257.  
  258.                Old-From 1:1/6
  259.  
  260.           This will match any message  which has its NetMail origin address
  261.           as 1:1/6.
  262.  
  263.                Old-To All Except 1:1/0 1 2 3 4 5
  264.                                  6 8 10 11 12 102
  265.                                  103 201 129/40
  266.  
  267.           This will match  any  message  which  is  not going to one of the
  268.           specified nodes in net 1:1 or going to 1:129/40.
  269.  
  270.           Note that for a successful match of any message,  both  the  Old-
  271.           From and Old-To clauses must  match successfully if they are both
  272.           supplied. (A rule with no "old" clauses will never  match  as  in
  273.           the second example in SAMPLE.CFG.)
  274.  
  275.                New-From 1:129/45
  276.  
  277.           This is an example of an action clause.    If  a  message matched
  278.           both the above  Old-From  and Old-To clauses, it's origin address
  279.           would be changed to be 1:129/45.
  280.  
  281.           If  we  wanted  to include other rewrite rules, they would follow
  282.           this one after a blank line in a similar manner to this example.
  283.  
  284.  
  285.  
  286.  
  287.  
  288.  
  289.  
  290.  
  291.  
  292.  
  293.  
  294.  
  295.  
  296.  
  297.  
  298.  
  299.  
  300.  
  301.                                         - 5 -
  302.  
  303.  
  304.  
  305.  
  306.  
  307.  
  308.  
  309.  
  310.  
  311.  
  312.                                       Chapter 4                                      Chapter 4
  313.  
  314.                                  Method of operation                                 Method of operation
  315.  
  316.  
  317.           Here's a play-by-play list of exactly what ChgAddr does.
  318.  
  319.             1.  ChgAddr finds  out what your RA environment variable is set
  320.                 to.  If it is undefined, the current directory is  used for
  321.                 all the system file processing.
  322.  
  323.             2.  CONFIG.RA is then read to load  the  message-base directory
  324.                 name as well as your system's primary network address.
  325.  
  326.             3.  Then, MESSAGES.RA  is  checked  for  your  systems  NetMail
  327.                 board.   Note that ChgAddr only looks  to  find  the  first
  328.                 message area which  is  marked for NetMail.  Any subsequent
  329.                 ones are ignored!
  330.  
  331.             4.  At this point, your configuration file is read in.  ChgAddr
  332.                 first checks the  current  directory and then looks in your
  333.                 RA system  directory  (as  defined  by  the  RA environment
  334.                 variable,   not   the   directory   specified  in  your  RA
  335.                 configuration file).
  336.  
  337.             5.  Once your configuration file has been parsed  and converted
  338.                 to  internal  rules,   ChgAddr  opens  up  MSGIDX.BBS  (for
  339.                 reading) and MSGHDR.BBS (for reading and possible writing).
  340.                 MSGINFO.BBS  is  read  in to get the statistics on how many
  341.                 messages are on the NetMail board.
  342.  
  343.             6.  MSGIDX.BBS is scanned for any  messages  which  are  on the
  344.                 NetMail board.  When one is found, MSGHDR.BBS  is  read for
  345.                 that particular record.  These  conditions  are  checked to
  346.                 see if a message qualifies for an address rewrite:
  347.                    -  The message is not deleted
  348.  
  349.                    -  The message is marked as "pending export"
  350.  
  351.                    -  The messages source and destination address match one
  352.                       of the rules listed in the ChgAddr configuration file
  353.  
  354.  
  355.  
  356.  
  357.  
  358.                                         - 6 -
  359.  
  360.  
  361.  
  362.  
  363.             7.  If the message's address needs  to  be  rewritten,  the new
  364.                 addresses are loaded  in  and the message header is written
  365.                 back to the MSGHDR.BBS file.
  366.  
  367.             8.  Steps 6 and 7 are repeated until all the  messages  on  the
  368.                 NetMail board have been checked.
  369.  
  370.  
  371.  
  372.  
  373.  
  374.  
  375.  
  376.  
  377.  
  378.  
  379.  
  380.  
  381.  
  382.  
  383.  
  384.  
  385.  
  386.  
  387.  
  388.  
  389.  
  390.  
  391.  
  392.  
  393.  
  394.  
  395.  
  396.  
  397.  
  398.  
  399.  
  400.  
  401.  
  402.  
  403.  
  404.  
  405.  
  406.  
  407.  
  408.  
  409.  
  410.  
  411.  
  412.  
  413.  
  414.  
  415.                                         - 7 -
  416.  
  417.  
  418.  
  419.  
  420.  
  421.  
  422.  
  423.  
  424.  
  425.  
  426.                                       Chapter 5                                      Chapter 5
  427.  
  428.                               Error levels and messages                              Error levels and messages
  429.  
  430.  
  431.           Only three errorlevels are used by ChgAddr.   They  are described
  432.           below.
  433.  
  434.           Errorlevel 1 indicates that a  necessary system file could not be
  435.           opened.  A system error message is given with  this  showing  the
  436.           particular file and the reason why it could not be opened.
  437.  
  438.           Errorlevel 2 is used when an I/O error occurs during  the reading
  439.           or writing of one of the system files.
  440.  
  441.           Errorlevel  3  is  for  ChgAddr's  errors.  These  are  generally
  442.           configuration  errors.    A  message  is  printed  on the  screen
  443.           explaining the problem.
  444.  
  445.           Since the first two errorlevels  represent  standard  DOS errors,
  446.           the error messages printed on  the console should be fairly self-
  447.           explanatory  (or  you  can use your DOS reference manual for more
  448.           information).   Errorlevel 3 could include  a  number  of  errors
  449.           including:
  450.  
  451.                Syntax error on line #
  452.                While ChgAddr was parsing your configuration file,  it could
  453.                not understand  something  on  the  line  number  specified.
  454.                Check   your  configuration  file  for  possible  typos   or
  455.                incorrect network address punctuation.
  456.  
  457.                Net address format error on line #
  458.                A network address  has  not been completely specified.  This
  459.                could be from using something  similar  to  "1:13"  where no
  460.                node  number  has  been  specified;  you   may   have  meant
  461.                "1:13/All".
  462.  
  463.                ALL cannot be used here on line #
  464.                You have used the "All" phrase in an invalid context.   This
  465.                could  be  in  "1:129/45 All" where you  should  simply  say
  466.                "1:129/All".  Also, you cannot use "All" in your new-rewrite
  467.                lines (New-From and New-To).
  468.  
  469.  
  470.  
  471.  
  472.                                         - 8 -
  473.  
  474.  
  475.  
  476.  
  477.                Keyword missing or invalid ("keyword") on line #
  478.                The keyword specified inside the  quotation  marks  has been
  479.                flagged as  invalid.    Check  for  misspellings  and proper
  480.                configuration file keywords.  It's  also  possible  that the
  481.                keyword was specified at  an  incorrect  time (such as using
  482.                "All" without specifying which pattern it is to match).
  483.  
  484.                Unrecognized keyword ("keyword") on line #
  485.                You have used a  keyword  in the right context, but it isn't
  486.                one  that ChgAddr knows about.  Check  the  chapter  on  the
  487.                configuration file  to ensure that you are using the correct
  488.                format.
  489.  
  490.  
  491.  
  492.  
  493.  
  494.  
  495.  
  496.  
  497.  
  498.  
  499.  
  500.  
  501.  
  502.  
  503.  
  504.  
  505.  
  506.  
  507.  
  508.  
  509.  
  510.  
  511.  
  512.  
  513.  
  514.  
  515.  
  516.  
  517.  
  518.  
  519.  
  520.  
  521.  
  522.  
  523.  
  524.  
  525.  
  526.  
  527.  
  528.  
  529.                                         - 9 -
  530.  
  531.  
  532.  
  533.  
  534.  
  535.  
  536.  
  537.  
  538.  
  539.  
  540.                                       Chapter 6                                      Chapter 6
  541.  
  542.                                        Support                                       Support
  543.  
  544.  
  545.           Support?  You've got to be kidding!  Ha ha ha ha ha!
  546.  
  547.           Well, actually, like most authors,  I  am  interested  in finding
  548.           (and killing) bugs.  If you do have problems  with  this  program
  549.           and just can't seem to get it to  work  for  you,  send a copy of
  550.           your CHGADDR.CFG file along with a description of  the  error (or
  551.           non-error) that you're getting and I'll see what I can do.
  552.  
  553.           (In order to prevent  file  name  duplication, please rename your
  554.           configuration when sending it to something that I will be able to
  555.           identify with your node.)
  556.  
  557.           My  system,  1:129/45,  is  reachable  24  hours  a  day  running
  558.           FrontDoor all that time.  THIS  BOARD  IS  NOT A SUPPORT BBS.  If
  559.           you send me, via NetMail, your question or problem, I will answer
  560.           it  to  the  best of my ability, but I don't  have  any  suitable
  561.           online conferences or files that will help you.
  562.  
  563.  
  564.  
  565.  
  566.  
  567.  
  568.  
  569.  
  570.  
  571.  
  572.  
  573.  
  574.  
  575.  
  576.  
  577.  
  578.  
  579.  
  580.  
  581.  
  582.  
  583.  
  584.  
  585.  
  586.                                         - 10 -
  587.  
  588.  
  589.  
  590.  
  591.  
  592.  
  593.  
  594.  
  595.                                    Table of Contents                                   Table of Contents
  596.  
  597.  
  598.  
  599.  
  600.  
  601.                Chapter 1  Introduction                               1
  602.  
  603.                Chapter 2  Requirements and restrictions              3
  604.  
  605.                Chapter 3  Configuration (rules) file                 4
  606.  
  607.                Chapter 4  Method of operation                        6
  608.  
  609.                Chapter 5  Error levels and messages                  8
  610.  
  611.                Chapter 6  Support                                   10
  612.  
  613.  
  614.  
  615.  
  616.  
  617.  
  618.  
  619.  
  620.  
  621.  
  622.  
  623.  
  624.  
  625.  
  626.  
  627.  
  628.  
  629.  
  630.  
  631.  
  632.  
  633.  
  634.  
  635.  
  636.  
  637.  
  638.  
  639.  
  640.  
  641.  
  642.  
  643.                                           i